# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=karchive5
pkgver=5.113.0
pkgrel=0
pkgdesc="Qt5 addon providing access to numerous types of archives"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later AND LGPL-2.1-or-later"
depends_dev="
	bzip2-dev
	qt5-qtbase-dev
	xz-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt5-qttools-dev
	samurai
	"
_repo_url="https://invent.kde.org/frameworks/karchive.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/karchive-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/karchive-$pkgver"

replaces="karchive<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -E "karchivetest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
96e10aa6673cb49bc8d99ca686634a80afb0e2eb6d324517357545892d5f596a0dac62863a010e59fcf7855c7020cb5e26b0c89e6b488832890d077e88e658cc  karchive-5.113.0.tar.xz
"
